# -*- coding: UTF-8 -*-
'''
Created on 16/10/2014

@author: Eduardo Cardeira - Num 6033

Exemplo 11 da Aula Teorica 4

'''
import sys

try:
    f = open('ficha.text')
    s = f.readline()
    i = int(s.strip())
except IOError as e:
    print "I/O error ({0}): {1}".format(e.errno, e.strerror)
except ValueError:
    print "Could not convert data to an integer."
except:
    print "Unexpected error:", sys.exc_info()[0]
    raise